package com.job.Gai_Yian.Homework0716;

import java.beans.SimpleBeanInfo;
import java.text.DecimalFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author Gai_Yian
 * @version 1.0
 * @since 2022-07-16 16:27:34
 */
public class UseFormat {
    public static void main(String[] args) throws ParseException {
        SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss SSS");
        Date date=new Date();
        String format=sdf.format(date);
        System.out.println(format);

        String str="2008-08-08 12:00:01 999";
        Date date1= sdf.parse(str);
        System.out.println(date1);

        DecimalFormat decimalFormat=new DecimalFormat("¥#,###,###,##0.00");
        String s=decimalFormat.format(12345678.97);
        System.out.println(s);
    }
}
